package com.ruoyi.web.controller.api.inventory;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.data.domain.DataInventory;
import com.ruoyi.data.service.IDataInventoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zzp
 * @version 1.0.0
 * @ClassName IndexController.java
 * @Description 积分接口
 * @createTime 2022年10月09日 16:05:00
 */
@Api("获取库存信息接口")
@RestController
@RequestMapping("/api/inventory")
public class InventoryController extends BaseController {

    @Autowired
    private IDataInventoryService inventoryService;

    @ApiOperation("获取库存信息")
    @GetMapping("/inventoryList")
    public AjaxResult inventoryList(DataInventory inventory) {
        inventory.setUserId(getUserId());
        List<DataInventory> list = inventoryService.selectDataInventoryListByUserId(inventory);
        return AjaxResult.success(list);
    }
}
